import { AnswerState } from '../../pages/ClassRoom/constant';
import { ProblemAnswer, ProblemDetail, ProblemResult } from '../common/problem';
import { TeacherAudio } from './getPlatformStudent';

export interface GetRoundListRes {
  code: number;
  data: Data;
  msg: string;
  traceId: string;
}

export interface RoundInfoProblem {
  explainType: number;
  readProblemVideo: VideoInfo;
  commonExplainVideo: VideoInfo;
  rightExplainVideo: VideoInfo;
  wrongExplainVideo: VideoInfo;
  startTime: number;
  readProblemDuration: number;
  answerDuration: number;
  problemId: number;
  rightNextRoundId: number;
  wrongNextRoundId: number;
  instantAnswers: InstantAnswer[];
  rightNextRound?: RoundInfo;
  wrongNextRound?: RoundInfo;
  problem?: ProblemDetail;
  haveSubmitAnswer?: boolean;
  userAnswer?: ProblemAnswer;
  answerResult?: ProblemResult;
  explainVideoProgress: number;
  doProblemProgress: number;
  answerDurationAfterDiscuss: number;
}

export interface RoundInfoMain {
  video: VideoInfo;
}

export interface VideoInfo {
  // videoId: number;
  // videoName: string;
  // videoUrl: string;
  // videoDownloadUrl: string;
  videoId: number;
  videoResourceType: number;
  originVideoPlayURL: string; // 原视频播放地址
  originVideoDownloadURL: string; // 原视频下载地址
  teacherVideoPlayURL: string; // 老师视频播放地址
  contentVideoPlayURL: string; // 内容视频播放地址
  teacherVideoDownloadURL: string; // 老师视频下载地址
  contentVideoDownloadURL: string; // 内容视频播放地址
}

export interface RoundInfoVideo {
  video: VideoInfo;
  roundProgress: number;
  instantAnswers: InstantAnswer[];
  isRest: boolean;
}

export interface RoundInfoRollCall {
  rollCallVideo: VideoInfo; // 点名视频信息
  rightVideo: VideoInfo; // 回答正确视频信息
  wrongVideo: VideoInfo; // 回答错误视频信息
  instantAnswers: InstantAnswer[]; // 即兴回答信息
  rollCallVideoDuration: number; // 点名视频时长
  doProblemProgress: number;
  explainVideoProgress: number;
}

export interface InstantAnswer {
  instantAnswerId: number;
  startTime: number;
  duration: number;
  isDefault: boolean;
  answerState?: AnswerState;
  options: string[];
  answer: string;
  title: RichText;
}

export interface RichText {
  textType: number;
  textStr: string;
}

export interface RoundInfo {
  serialId: number;
  roundId: number;
  roundName: string;
  status: number;
  duration: number;
  roundType: number;
  roundInfoMain: RoundInfoMain;
  roundInfoProblem: RoundInfoProblem;
  roundInfoVideo: RoundInfoVideo;
  stageId: number;
  aboveTotalTime: number;
  roundInfoRollCall: RoundInfoRollCall; // 上台互动题环节信息
}

export interface Data {
  rounds: RoundInfo[];
  teacherName: string;
  teacherAudios: TeacherAudio[];
}
